<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
</head>

<body>
<div class="layuimini-container" id="vue">
    <div class="layuimini-main">



        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>


    </div>
</div>
<script type="text/html" id="businessType">
    {{#  if(d.businessType === 5 ){ }}
    <button class="layui-btn layui-btn-xs layui-btn-normal" >上传</button>
    {{#  } }}
    {{#  if(d.businessType === 6 ){ }}
    <button class="layui-btn layui-btn-xs layui-btn">下载</button>
    {{#  } }}
    {{#  if(d.businessType === 7 ){ }}
    <button class="layui-btn layui-btn-xs layui-btn-warm">退回</button>
    {{#  } }}
</script>
<script type="text/html" id="state">
    {{#  if(d.state === true ){ }}
    <button class="layui-btn layui-btn-xs layui-btn-normal" >完成</button>
    {{#  } }}
    {{#  if(d.state === false ){ }}
    <button class="layui-btn layui-btn-xs layui-btn-danger">失败</button>
    {{#  } }}
</script>
<script src="../../lib/layui-v2.7.3/layui/layui.js" charset="utf-8"></script>
<script src="../../api/urlConfig.js"></script>
<script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script>





    layui.use(['table', 'util'], function(){
        var table = layui.table
            ,util = layui.util;

        //监听单元格编辑
        table.on('edit(currentTableId)', function(obj){
            var value = obj.value //得到修改后的值
                ,data = obj.data //得到所在行所有键值
                ,field = obj.field; //得到字段
        });
    });

    layui.use(['form', 'table','upload'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
        table.render({
            elem: '#currentTableId',
            // url: '../api/table.json',	
			url:ipURL+"/caption/file/record/page",
            headers:{token:localStorage.token},
			parseData: function(res){ //res 即为原始返回的数据
			    return {
			      "code": res.code, //解析接口状态
			      "msg": res.message, //解析提示文本
			      "count": res.count, //解析数据长度
			      "data": res.data.data,//解析数据列表
				  
			    };	
				
			},
			
			response: {
			            statusCode: 0//规定成功的状态码，默认：0
			        },
			text:{none: '无数据'},
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {field: 'fileName', title: '文件名', },
                {field: 'fileSize', title: '文件大小',sort: true,},
                {field: 'taskName', title: '任务名称'},
                {field: 'businessType', title: '操作类型',templet: '#businessType'},
                {field: 'state', title: '状态',templet: '#state'},
                {field: 'os', title: '操作系统'},
                {field: 'userName', title: '用户'},
                {field: 'gmtCreated', title: '操作时间'},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true,
            skin: 'line'
        });


        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {

			var level = $("#levelSelect").val()
			var serviceType = $("#serviceNamesSelect").val()
			var content = $('input[name="content"]').val()

            //执行搜索重载
            table.reload('currentTableId', {
				
                page: {
                    curr: 1
                }
                , where: {
                    level:level,
                    serviceType:serviceType,
                    content:content,
                }
            });

            return false;
        });






    });
</script>

</body>



</html>